<%= render_partial 'header' %>

<div class="forum-title">
    <h2><%= link_to @forum.name, :controller => 'forum', :action => 'show', :id => @forum %></h2>
</div>

<%= render_partial 'breadcrumbs' %>

<%= render_partial 'post_new_topic' %>
<div class="topics">
  <% for topic in @topics %>
    <div class="topic">
	  <h3><%= link_to topic.name, :controller => 'topic', :action => 'show', :id => topic %></h3>
      <div class="topic-replies">
	    <span class="topic-replies-header">Replies</span>
	    <%=h topic.replies %>
	  </div>
	  <div class="topic-author">
	    <span class="topic-author-header">Author</span>
	    <%= link_to topic.author.login, :controller => 'profile', :action => 'show', :id => topic.author.profile %>
	  </div>
	  <div class="topic-views">
	    <span class="topic-views-header">Views</span>
	    <%= topic.views %>
	  </div>
	  <div class="topic-last">
	    <span class="topic-last-header">Last post</span>
	    <span class="topic-last-posttime"><%= topic.latest_post.created_at.strftime('%b %d, %Y %I:%M %p') %></span>
	    <span class="topic-last-user"><%= link_to topic.latest_user.login, :controller => 'profile', :action => 'show', :id => topic.latest_user.profile %></span>
      </div>
    </div>
  <% end %>
</div>
<%= render_partial 'post_new_topic' %>

<%= render_partial 'breadcrumbs' %>

<div class="topics-previous">
  <%= link_to 'Previous page', { :page => @topic_pages.current.previous } if @topic_pages.current.previous %>
</div>

<div class="topic-next">
  <%= link_to 'Next page', { :page => @topic_pages.current.next } if @topic_pages.current.next %> 
</div>
